package xyz.chaobei.feature.utils;

import java.util.function.Consumer;

/**
 * @author <a href='mailto:maruichao52@gmail.com'>MRC</a>
 * @since 2021/2/4
 */
public class ConsumerTest {

    /**
     * <p>Consumer 链式处理
     * <p>author: <a href='mailto:maruichao52@gmail.com'>MRC</a>
     * @param args
     * @since 2021/2/4
     * @return void
     **/
    public static void main(String[] args) {

        // 无返回的处理
        Consumer<String> custom = (str) -> System.out.println("first" + str);
        Consumer<String> desc = custom.andThen((str) -> System.out.println("second" + str));

        desc.accept("hello");

    }

}
